/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "interaction")
@NamedQueries({
    @NamedQuery(name = "Interaction.findAll", query = "SELECT i FROM Interaction i"),
    @NamedQuery(name = "Interaction.findByIdinteraction", query = "SELECT i FROM Interaction i WHERE i.idinteraction = :idinteraction"),
    @NamedQuery(name = "Interaction.findByInteractionrelatedinformation", query = "SELECT i FROM Interaction i WHERE i.interactionrelatedinformation = :interactionrelatedinformation"),
    @NamedQuery(name = "Interaction.findByModified", query = "SELECT i FROM Interaction i WHERE i.modified = :modified"),
    @NamedQuery(name = "Interaction.findByIsrestricted", query = "SELECT i FROM Interaction i WHERE i.isrestricted = :isrestricted")})
public class Interaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idinteraction")
    private Integer idinteraction;
    @Column(name = "interactionrelatedinformation")
    private String interactionrelatedinformation;
    @Column(name = "modified")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modified;
    @Column(name = "isrestricted")
    private Boolean isrestricted;
    @JoinColumn(name = "idspecimen2", referencedColumnName = "idspecimen")
    @ManyToOne(fetch = FetchType.LAZY)
    private Specimen specimen;
    @JoinColumn(name = "idspecimen1", referencedColumnName = "idspecimen")
    @ManyToOne(fetch = FetchType.LAZY)
    private Specimen specimen1;
    @JoinColumn(name = "idinteractiontype", referencedColumnName = "idinteractiontype")
    @ManyToOne(fetch = FetchType.LAZY)
    private Interactiontype interactiontype;

    public Interaction() {
    }

    public Interaction(Integer idinteraction) {
        this.idinteraction = idinteraction;
    }

    public Integer getIdinteraction() {
        return idinteraction;
    }

    public void setIdinteraction(Integer idinteraction) {
        this.idinteraction = idinteraction;
    }

    public String getInteractionrelatedinformation() {
        return interactionrelatedinformation;
    }

    public void setInteractionrelatedinformation(String interactionrelatedinformation) {
        this.interactionrelatedinformation = interactionrelatedinformation;
    }

    public Date getModified() {
        return modified;
    }

    public void setModified(Date modified) {
        this.modified = modified;
    }

    public Boolean getIsrestricted() {
        return isrestricted;
    }

    public void setIsrestricted(Boolean isrestricted) {
        this.isrestricted = isrestricted;
    }

    public Specimen getSpecimen() {
        return specimen;
    }

    public void setSpecimen(Specimen specimen) {
        this.specimen = specimen;
    }

    public Specimen getSpecimen1() {
        return specimen1;
    }

    public void setSpecimen1(Specimen specimen1) {
        this.specimen1 = specimen1;
    }

    public Interactiontype getInteractiontype() {
        return interactiontype;
    }

    public void setInteractiontype(Interactiontype interactiontype) {
        this.interactiontype = interactiontype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idinteraction != null ? idinteraction.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Interaction)) {
            return false;
        }
        Interaction other = (Interaction) object;
        if ((this.idinteraction == null && other.idinteraction != null) || (this.idinteraction != null && !this.idinteraction.equals(other.idinteraction))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Interaction[idinteraction=" + idinteraction + "]";
    }

}
